#ifndef __M_LEVEL_H__
#define __M_LEVEL_H__ 

namespace log {
    class LogLevel {
    public:
        enum class Value {
            UNKONW = 0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };
        /*static const char* to_string(LogLevel::Value level) {
            switch(level) {
                case LogLevel::Value::DEBUG: return "DEBUG"; break;
                case LogLevel::Value::INFO: return "INFO"; break;
                case LogLevel::Value::WARN: return "WARN"; break;
                case LogLevel::Value::ERROR: return "ERROR"; break;
                case LogLevel::Value::FATAL: return "FATAL"; break;
                case LogLevel::Value::OFF: return "OFF"; break;
            }
            return "UNKNOW";
        }*/
        static const char* to_string(LogLevel::Value level) {
            switch(level) {
                #define TOSTRING(LEVEL) #LEVEL
                case LogLevel::Value::DEBUG: return TOSTRING(DEBUG); break;
                case LogLevel::Value::INFO: return TOSTRING(INFO); break;
                case LogLevel::Value::WARN: return TOSTRING(WARN); break;
                case LogLevel::Value::ERROR: return TOSTRING(ERROR); break;
                case LogLevel::Value::FATAL: return TOSTRING(FATAL); break;
                case LogLevel::Value::OFF: return TOSTRING(OFF); break;
                #undef TOSTRING
            }
            return "UNKNOW";
        }
    };
}

#endif
